<template>
  <div class="header-wrap">
    <a-form layout="inline" :model="searchProp" @finish="handleFinish">
      <a-form-item label="单号检索" name="orderCode">
        <a-input
          v-model:value="searchProp.orderCode"
          placeholder="请输入"
          clearable
        />
      </a-form-item>
      <a-form-item label="用户姓名检索" name="userName">
        <a-input
          v-model:value="searchProp.userName"
          placeholder="请输入"
          clearable
        />
      </a-form-item>
      <a-form-item label="用户手机检索" name="userMobile">
        <a-input
          v-model:value="searchProp.userMobile"
          placeholder="请输入"
          clearable
        />
      </a-form-item>
      <a-form-item>
        <a-button type="primary" html-type="submit"> 搜索 </a-button>
        <a-button type="default" @click="resetForm" style="margin-left: 10px">
          重置
        </a-button>
      </a-form-item>
    </a-form>
  </div>
</template>

<script setup>
import { ref } from 'vue'
const emit = defineEmits(['confirm'])
const props = defineProps({})
const searchProp = ref({})

const handleFinish = (values) => {
  emit('confirm', values)
}
const resetForm = (e) => {
  searchProp.value = {}
  emit('confirm', searchProp)
}
</script>

<style scoped lang="less"></style>
